-- Stale uzywane w projekcie

library IEEE;
use IEEE.Std_Logic_1164.all;

package constants is
  -- instrukcje
  constant CMP : std_logic_vector(1 downto 0);
  constant MOV : std_logic_vector(1 downto 0);
  constant NEG : std_logic_vector(1 downto 0);
  constant XCHG : std_logic_vector(1 downto 0);
  
  -- tryby adresowania
  constant REJ : std_logic_vector(1 downto 0);
  constant NAT : std_logic_vector(1 downto 0);
  constant PRZ : std_logic_vector(1 downto 0);
  constant BAZ : std_logic_vector(1 downto 0);
  
  -- flagi
  constant CF : integer;
  constant ZF : integer;
  constant SF : integer;
  constant OVF : integer;
  
  -- generator adresu
  constant GA_PC : std_logic_vector(2 downto 0);
  constant GA_IMM : std_logic_vector(2 downto 0);
  constant GA_REG1 : std_logic_vector(2 downto 0);
  constant GA_REG2 : std_logic_vector(2 downto 0);
  constant GA_REG3 : std_logic_vector(2 downto 0);
  constant GA_REG4 : std_logic_vector(2 downto 0);
  constant GA_REG5 : std_logic_vector(2 downto 0);
  constant GA_REG6 : std_logic_vector(2 downto 0);
  
  -- bledy
  constant NO_ERROR : std_logic_vector(1 downto 0);
  constant ERR_BAD_INSTR : std_logic_vector(1 downto 0);
  constant ERR_OUT_OF_MEM : std_logic_vector(1 downto 0);
end constants;

package body constants is
  constant CMP : std_logic_vector(1 downto 0)  := "00";
  constant MOV : std_logic_vector(1 downto 0)  := "01";
  constant NEG : std_logic_vector(1 downto 0)  := "10";
  constant XCHG : std_logic_vector(1 downto 0) := "11";
  
  constant REJ : std_logic_vector(1 downto 0) := "00";
  constant NAT : std_logic_vector(1 downto 0) := "01";
  constant PRZ : std_logic_vector(1 downto 0) := "10";
  constant BAZ : std_logic_vector(1 downto 0) := "11";
  
  constant CF : integer := 3;
  constant ZF : integer := 2;
  constant SF : integer := 1;
  constant OVF : integer := 0;
  
  constant GA_PC : std_logic_vector(2 downto 0)   := "000";
  constant GA_IMM : std_logic_vector(2 downto 0)  := "001";
  constant GA_REG1 : std_logic_vector(2 downto 0) := "010";
  constant GA_REG2 : std_logic_vector(2 downto 0) := "011";
  constant GA_REG3 : std_logic_vector(2 downto 0) := "100";
  constant GA_REG4 : std_logic_vector(2 downto 0) := "101";
  constant GA_REG5 : std_logic_vector(2 downto 0) := "110";
  constant GA_REG6 : std_logic_vector(2 downto 0) := "111";
  
  constant NO_ERROR : std_logic_vector(1 downto 0) := "00";
  constant ERR_BAD_INSTR : std_logic_vector(1 downto 0) := "11";
  constant ERR_OUT_OF_MEM : std_logic_vector(1 downto 0) := "10";
end constants;
